package com.api.core.exception;

import com.api.core.result.ResultCodeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class ServiceException extends RuntimeException {
    /**
     * 异常信息
     */
    private String message;
    /**
     * 状态码
     */
    private int code;

    public ServiceException(String message, int code) {
        this.message = message;
        this.code = code;
    }

    public ServiceException(String message) {
        this.message = message;
        this.code = ResultCodeEnum.BASE_ERROR_CODE.getCode ();
    }
}
